# geogrid extension makefile.in 
GEOGRID_MAJRO_VERSION=1
GEOGRID_MINOR_VERSION=0
POSTGIS_PGSQL_VERSION=92

EXTENSION = yukon_geogridcoder        # the extensions name
#MODULE_big = yukon_geogridcoder-$(GEOGRID_MAJRO_VERSION).$(GEOGRID_MINOR_VERSION)
MODULE_big = yukon_geogridcoder-1.0
DATA = yukon_geogridcoder--1.0.1.sql  yukon_geogridcoder--1.0--1.0.1.sql# script files to install

GEOGRID_OBJS= \
    RasterizeHash.o \
    UGGeoHash.o \
    GeoGrid.o \
    GSGUtil.o \
    rasterize_grid.o \
    geomgrid_ops.o \
    geosot.o

OBJS=$(GEOGRID_OBJS)

uname_m = $(shell uname -m)
LD_FLAGS.x86_64 = ../geomodel/libUGC/Builds/MakeProject/Bin64_Linux
LD_FLAGS.aarch64 = ../geomodel/libUGC/Builds/MakeProject/Binaarch64_Linux
LD_FLAGS += $(LD_FLAGS.$(uname_m))

override CFLAGS :=-I../liblwgeom -I../include  -fpermissive $(IS_DEBUG)
PG_CPPFLAGS += -fPIC -I../geomodel/libUGC/Include -I../raster/rt_core/ -I../raster/rt_pg $(CFLAGS) @CPPFLAGS@ @LIBGDAL_CFLAGS@  -w 

#librtcore.a 的位置要放在 liblwgeom.a 的前面（librtcore.a 依赖于 liblwgeom.a），否则会造成有些函数无法链接到动态库
SHLIB_LINK = ../raster/rt_core/librtcore.a ../liblwgeom/.libs/liblwgeom.a ../libpgcommon/libpgcommon.a -L$(LD_FLAGS) -lYkGeometry3D @SHLIB_LINK@  @LIBGDAL_LDFLAGS@ 

# postgres build stuff
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)

include $(PGXS)

distclean: clean
	rm -f Makefile